﻿using System;
using umbraco.cms.businesslogic.datatype;
using umbraco.interfaces;

namespace Eksponent.CropUp.Umbraco
{
    public class CropUpDataType : BaseDataType, IDataType
    {
        public override Guid Id
        {
            get {  return new Guid("11278594-B8D4-4CC6-A0FA-FD9C91BD6B4E"); }
        }

        public override string DataTypeName
        {
            get { return "Eksponent CropUp"; }
        }        

        public CropUpDataType() : base()
        {
            DBType = DBTypes.Ntext;            
        }



        private Cropper _dataEditor;
        public override IDataEditor DataEditor
        {
            get { return _dataEditor = (_dataEditor ?? new Cropper(this)); }
        }

        private CropperPrevalueEditor _prevalueEditor;
        public override IDataPrevalue PrevalueEditor
        {
            get { return _prevalueEditor = (_prevalueEditor ?? new CropperPrevalueEditor(this)); }
        }

        private IData _data;
        public override IData Data
        {
            get { return _data = _data ?? new DefaultData(this); }
        }
    }
}
